home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15371 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: axe.humboldt.edu!etb1
  2. From: etb1@Axe.Humboldt.edu (Eric Brower)
  3. Newsgroups: comp.lang.c
  4. Subject: [Q] Best handling of non-fixed-length data??
  5. Date: 18 Apr 1996 18:39:43 GMT
  6. Organization: Information Resources and Technology
  7. Message-ID: <4l629f$4cc@nuke.csu.net>
  8. NNTP-Posting-Host: axe.humboldt.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Hi there, and thanks in advance for taking the time.  
  12. I consider myself an adept, however novice, programmer in C;
  13. but I need advice on the best way to manage non-fixed-length data.
  14.  
  15. Here is my application:  I would like to store exam questions, along with
  16. the correct answer and as many other possible answers per question, in a 
  17. file.  From this file, I would like to be able to extract the question
  18. and all possible answers through the question number I assign each question
  19. within the database.  My problem lies in memory management, as well as
  20. method of storing this data.  You see, I'd like questions to be as long
  21. as need be, without using hideous amounts of space for the short questions
  22. as well.  As well, some questions may have only two possible answers, while
  23. other may have five or more.  I also must be able to extract the correct 
  24. answer from among the possibles.
  25.  
  26. I had thought of using a structure, but I am not sure of how to vary the
  27. amount of entries, array sizes, etc.
  28.  
  29. ALLOW ME TO CLARIFY-- I am in no way asking anyone to do my work/programming
  30. for me; I quite enjoy figuring these things out myself, but I need a bit of
  31. experienced advice in this arena.
  32.  
  33. Thanks in advance; e-mail is preferred (I will summarize).
  34. Eric
  35.  
  36.  
  37.  
  38.  
  39.